package view;

import java.awt.Graphics;
import java.awt.Image;
import java.net.URL;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class BackgroundPanel extends JPanel 
{
	private JFrame background;
	private URL locatie;
	
	public BackgroundPanel(JFrame frame, URL locatie)
	{
		background = frame;
		this.locatie = locatie;
	}
	public void paintComponent(Graphics g)
	{
		ImageIcon icon = null;
		super.paintComponent(g);
		icon = new ImageIcon(locatie);
		Image backgroundImage = icon.getImage();
		g.drawImage(backgroundImage, 0, 0, background.getWidth(), background.getHeight(), background);
	}
}
